#coding:utf-8
import sys

from django.contrib import admin
from .models import EnvironmentName,Host,Runapp,Appport

class EnvironmentNameAdmin(admin.ModelAdmin):
    list_display = ('name', 'desc')


class HostAdmin(admin.ModelAdmin):
    list_display = ('hostname', 'desc', 'internetIP', 'intranetIP')


class RunappAdmin(admin.ModelAdmin):
    list_display = ('appname',)
    fieldsets = (
        (None, {'fields':('appname','ports')}),
    )
    filer_horizontal = ('ports')


class AppportAdmin(admin.ModelAdmin):
    list_display = ('port',)


admin.site.register(EnvironmentName,EnvironmentNameAdmin)
admin.site.register(Host,HostAdmin)
admin.site.register(Runapp,RunappAdmin)
admin.site.register(Appport,AppportAdmin)










